<template>
  <div class="no-auth">
    暂无权限访问
  </div>
</template>
<script>
import { mapState } from 'vuex'
import { getCurrentRoutes } from '@/utils'
export default {
  name: 'NoAuth',
  computed: {
    ...mapState(['menus', 'routes', 'menuType', 'menuTypeMap'])
  },
  watch: {
    menuType(val) {
      // this.$router.push(this.routes[0]);
      const currentRoutes = this.getCurrentRoutes()
      if (currentRoutes && currentRoutes.length !== 0) {
        this.$router.push(currentRoutes[0])
      }
    }
  },
  created() {
    const currentRoutes = this.getCurrentRoutes()
    if (currentRoutes && currentRoutes.length !== 0) {
      this.$router.push(currentRoutes[0])
    }
  },
  methods: {
    getCurrentRoutes
  }
}
</script>

<style scoped lang="scss">
.no-auth {
  padding-top: 40px;
  font-size: 20px;
  text-align: center;
  color: #c00;
}
</style>

